using System;
using System.ComponentModel;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
using System.Windows.Forms;

namespace Splino
{            
    /// <summary>
    /// Global image list for all Splino Icons
    /// </summary>
    public partial class SplinoImageList : Component
    {
        /// <summary>
        /// Images collection
        /// </summary>
        public ImageList.ImageCollection Images
        {
            get { return _imageList.Images; }
        }

        /// <summary>
        /// The ImageList this User Control Contains
        /// </summary>
        public ImageList ImageList
        {
            get { return _imageList; }
        }

        private static readonly object padlock = new object();
        private static volatile SplinoImageList _instance;
        /// <summary>
        /// The singleton instance for global access to the Splino ImageList
        /// </summary>
        public static SplinoImageList Instance
        {

            get
            {
                if (_instance == null)
                    lock (padlock)
                    {
                        if (_instance == null)
                            _instance = new SplinoImageList();
                    }
                return _instance;
            }
        }
            
        private SplinoImageList()
        {
            InitializeComponent();
        }

        private SplinoImageList(IContainer container)
        {
            container.Add(this);

            InitializeComponent();
        }
    }
}
